package com.xiebang.extenddemo2;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-09-12
 * Time:11:15
 */
final class A{

}//密封类，当前的类不能被继承
//修饰方法，就是密封方法
//修饰常数，不能被修改

//组合也是面向对象的一种方法
class Base{
    public int a = 1;
    public int b = 2;
}
class Derieve extends Base{
    public int a = 3;
    public void func(){
        System.out.println("运行函数func");
        System.out.println(a);
        System.out.println(this.a);
        System.out.println(super.a);//super只会指向直接的父类
    }

}
public class test {
    public static void main(String[] args) {
        Derieve derieve = new Derieve();
        derieve.func();
    }
}
